package o;

import com.huawei.gamebox.plugin.gameservice.db.tables.GameSubAcctRecord;
import java.util.List;

public class ezg {
    private static ezg ˊ = null;
    private static final String ˋ = GameSubAcctRecord.class.getSimpleName();
    private cfu ˎ = euc.ˊ().ʽ(ˋ);

    public static synchronized ezg ॱ() {
        ezg o_ezg;
        synchronized (ezg.class) {
            if (ˊ == null) {
                ˊ = new ezg();
            }
            o_ezg = ˊ;
        }
        return o_ezg;
    }

    private ezg() {
    }

    public void ˏ() {
        this.ˎ.ˋ("", new String[0]);
    }

    public long ˋ(GameSubAcctRecord gameSubAcctRecord) {
        if (dof.ॱ(gameSubAcctRecord.ˋ()) || dof.ॱ(gameSubAcctRecord.ˊ())) {
            return -2;
        }
        if (gameSubAcctRecord.ॱ() == null) {
            gameSubAcctRecord.ˋ("");
        }
        if (ˊ(gameSubAcctRecord) <= 0) {
            return this.ˎ.ˎ(gameSubAcctRecord);
        }
        return -2;
    }

    public int ˊ(GameSubAcctRecord gameSubAcctRecord) {
        return this.ˎ.ॱ(gameSubAcctRecord, "accountId_=? and appId_=? and gameSubUserId_=? ", new String[]{gameSubAcctRecord.ˋ(), gameSubAcctRecord.ˊ(), gameSubAcctRecord.ॱ()});
    }

    public List<GameSubAcctRecord> ॱ(String str, String str2) {
        return this.ˎ.ˋ(GameSubAcctRecord.class, "accountId_=? and appId_=?", new String[]{str, str2}, null, "gameSubUserId_ desc");
    }
}
